// 手写getType函数，传入一个变量，需要返回该变量的类型
function getType(a) {
  const _type = Object.prototype.toString.call(a);
  const len = "[object".length;
  const type = _type.slice(len, _type.length - 1);
  return type;
}

console.log(getType("a"));
console.log(getType({}));
